}
}
+ gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (native));
g_object_unref (native);
}
GtkNativeDialogClass
gtk_native_dialog_show
gtk_native_dialog_hide
+gtk_native_dialog_destroy
gtk_native_dialog_get_visible
gtk_native_dialog_set_modal
gtk_native_dialog_get_modal
priv->dialog = NULL;
}
- g_clear_object (&priv->native);
+ if (priv->native)
+ {
+ gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (priv->native));
+ g_clear_object (&priv->native);
+ }
priv->chooser = NULL;
g_object_notify_by_pspec (G_OBJECT (self), native_props[PROP_VISIBLE]);
}
+/**
+ * gtk_native_dialog_destroy:
+ * @self: a #GtkNativeDialog
+ *
+ * Destroys a dialog.
+ *
+ * When a dialog is destroyed, it will break any references it holds
+ * to other objects. If it is visible it will be hidden and any underlying
+ * window system resources will be destroyed.
+ *
+ * Note that this does not release any reference to the object (as opposed to
+ * destroying a GtkWindow) because there is no reference from the windowing
+ * system to the #GtkNativeDialog.
+ *
+ * Since: 3.20
+ **/
+void
+gtk_native_dialog_destroy (GtkNativeDialog *self)
+{
+ g_return_if_fail (GTK_IS_NATIVE_DIALOG (self));
+
+ g_object_run_dispose (G_OBJECT (self));
+}
+
void
_gtk_native_dialog_emit_response (GtkNativeDialog *self,
int response_id)
GDK_AVAILABLE_IN_3_20
void gtk_native_dialog_hide (GtkNativeDialog *self);
GDK_AVAILABLE_IN_3_20
+void gtk_native_dialog_destroy (GtkNativeDialog *self);
+GDK_AVAILABLE_IN_3_20
gboolean gtk_native_dialog_get_visible (GtkNativeDialog *self);
GDK_AVAILABLE_IN_3_20
void gtk_native_dialog_set_modal (GtkNativeDialog *self,
}
}
+static void
+destroy_native (GtkFileChooserNative *native)
+{
+ gtk_native_dialog_destroy (GTK_NATIVE_DIALOG (native));
+ g_object_unref (native);
+}
+
void
create_native_dialogs (GtkWidget *widget)
{
"_accept&native",
"_cancel__native");
- g_signal_connect_swapped (G_OBJECT (window), "destroy", G_CALLBACK (g_object_unref), native);
+ g_signal_connect_swapped (G_OBJECT (window), "destroy", G_CALLBACK (destroy_native), native);
gtk_file_chooser_add_shortcut_folder (GTK_FILE_CHOOSER (native),
g_get_current_dir (),